import unittest

from api.ihrm_employ_api import IhrmEmployApi
from common.assert_util import aassert_util


class TestIhrmApi(unittest.TestCase):

    def test01_add_rmp(self):
        header = {"Content-Type": "application/json", "Authorization": "Bearer d65fdb7e-c092-4d22-8388-325894fa1653"}
        json_data = {
            "username": "业猪021",
            "mobile": "13977624571",
            "workNumber": "9547"
        }
        resp = IhrmEmployApi.add_emp(header, json_data)
        print("添加",  resp.json())

        aassert_util(self,resp,200,True, 10000, "操作成功")

    def test02_add_rmp(self):
        header = {"Content-Type": "application/json", "Authorization": "Bearer d65fdb7e-c092-4d22-8388-325894fa1653"}
        json_data = {
            "username":"小i佩奇",
            "mobile":"13800195477",
            "workNumber":"9729",
            "formOfEmployment":"1"
        }
        resp = IhrmEmployApi.add_emp(header, json_data)
        print("添加-组合",  resp.json())

        aassert_util(self,resp,200,True, 10000, "操作成功")

    # def test03_add_rmp(self):
    #     header = {"Content-Type": "application/json", "Authorization": "Bearer 4b1d8b35-ac53-4909-b5b6-7d5895b611d5"}
    #     json_data = {
    #         "username":"乔",
    #         "mobile":"13569078432",
    #         "timeOfEntry":"2022-8-01",
    #         "formOfEmployment":"1",
    #         "workNumber":"7388",
    #         "departmentName":"测试",
    #
    #
    #     }
    #     resp = IhrmEmployApi.add_emp(header, json_data)
    #     print("添加-全部",  resp.json())
    #
    #     aassert_util(self,resp,200,True, 10000, "操作成功")